/*
 * @(#)SingleThreadCalculator.java    Jul 19, 2010
 *
 * Copyright 2009 Nyber Shanghai, Inc. All rights reserved.
 */

package com.lab.util.concurrent;

/**
 * Class description goes here.
 *
 * @author nickevin@gmail.com
 * @version Jul 19, 2010 9:30:27 AM
 */

public class SingleThreadCalculator {

	public long calc(long[] values, int start, int end) {
		if (values == null || values.length == 0) {
			return 0;
		}

		long sum = 0;
		for (int i = start; i < end; i++) {
			sum += values[i];
		}

		return sum;
	}
}
